package com.firewolf.springboot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.firewolf.springboot.intercepters.MyIntercepter;

@Configuration
public class MyWebAppConfigure extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 通过这种方式添加拦截器
		registry.addInterceptor(new MyIntercepter()).addPathPatterns("/**");
		super.addInterceptors(registry);
	}
}
